package cn.tp.ksoft.civil_driver.bean;

import android.annotation.SuppressLint;

import java.io.Serializable;
import java.util.Date;

public class OrderBean implements Serializable,Comparable<OrderBean>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long id;
	
	private Long memberId;
	
	/**
	 * 订单号
	 */
	private String orderNo;
	
	/**
	 * 订单类型: 1 机票 ...
	 */
	private Integer type;
	
	/**
	 * 订单详情
	 */
	private String detail;

	private OrderDetailBean detailBean;

	/**
	 * 订单金额
	 */
	private Double orderMoney =0D;
	
	/**
	 * 优惠金额
	 */
	private Double discountMoney =0D;
	
	/**
	 * 应付金额
	 */
	private Double payMoney =0D;
	
	/**
	 * 优惠说明
	 */
	private String discountDes;
	
	/**
	 * 订单时间
	 */
	private Date orderTime = new Date();
	
	/**
	 * 订单更新时间
	 */
	private Date modifyTime;
	
	/**
	 * 支付时间
	 */
	private Date payTime;
	
	/**
	 * 订单状态  1：待付款 2：已付款（已完成 ）3：取消  4：关闭 
	 * 保洁服务公务员端：11：提交订单   12：预约成功(未开始服务之前)  13：待付款（服务已完成未支付费用）    14：已完成（已付款）
	 * 保洁员端：                11：待接单       12：已接单(未开始服务之前)    13: 已完成（服务已完成未支付费用）   4:已关闭（客户取消、超时未接、拒接）
	 * 用车服务公务员端：21：提交订单   22：预约成功(未开始服务之前)  23：待付款（服务已完成未支付费用）    24：已完成（已付款）
	 * 用车司机端：            21：待接单       22：已接单(未开始服务之前)    23: 已完成（服务已完成未支付费用）   4:已关闭（客户取消、超时未接、拒接）
	 */
	private Integer status;
	
	/**
	 * 扩展状态 1:出票中 2：已出票    
	 *       
	 */
	private Integer extStatus;
	
	/**
	 * 提供商ID
	 */
	private Long providerId;
	
	/**
	 * 供应商名称（商户名）
	 */
	private String providerName;
	/**
	 * 是否需要邮寄 false：不需要  true:需要
	 */
	private Boolean mail;
	
	/**
	 * 邮寄物品信息，多个用英文逗号分隔
	 */
	private String mailGoods ;
	
	/**
	 * 邮费
	 */
	private Double mailFee =0d;
	
	/**
	 * 收货地址-省份
	 */
	private String province;
	
	/**
	 * 收货地址-城市
	 */
	private String city;
	
	/**
	 * 收货地址-地区
	 */
	private String district;
	
	/**
	 * 收货地址-详细地址
	 */
	private String address;
	
	/**
	 * 收货联系人-电话
	 */
	private String tel;
	
	/**
	 * 收货联系人-姓名
	 */
	private String name;
	
	/**
	 * 收货地址-邮编
	 */
	private String post;
	
	/**
	 * 是否周末送货 0 ：工作日 1：可周末
	 */
	private boolean isWeekendRec;
	
	/**
	 * 联系人姓名
	 */
	private String contact;
	
	/**
	 * 联系人电话
	 */
	private String contactTel;
	/**
	 * 第三方订单标号,多个逗号分隔
	 */
	private String thirdOrderNo;
	
	/**
	 * 发票抬头
	 */
	private String invoiceTitle;
	
	/**
	 * 订单有效时间（用于查询时判断机票订单完成状态）
	 */
	private Date lastValidTime;
	/**
	 * 行程或服务开始时间(用于存放机票订单的行程开始时间、用车、保洁服务的开始时间)
	 */
	private Date validTime;
	/**
	 * 服务对象，多个用顿号分隔
	 */
	private String servedPerson = "";
	/**
	 * 备注
	 */
	private String remark;
	/**
	 * 标注类型
	 */
	private Integer markType;
	
	/**
	 * 标注说明
	 */
	private String markContent;
	
	/**
	 *  是否被评价 true:已评价  false ：否
	 */
	private Boolean evaluated = false;
	/**
	 * 接单剩余时间
	 */
	private long time;

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public Integer getMarkType() {
		return markType;
	}

	public void setMarkType(Integer markType) {
		this.markType = markType;
	}


	public Boolean getEvaluated() {
		return evaluated;
	}

	public void setEvaluated(Boolean evaluated) {
		this.evaluated = evaluated;
	}

	public String getMarkContent() {
		return markContent;
	}

	public void setMarkContent(String markContent) {
		this.markContent = markContent;
	}

	public Date getLastValidTime() {
		return lastValidTime;
	}

	public void setLastValidTime(Date lastValidTime) {
		this.lastValidTime = lastValidTime;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public OrderDetailBean getDetailBean() {
		return detailBean;
	}

	public void setDetailBean(OrderDetailBean detailBean) {
		this.detailBean = detailBean;
	}

	public Double getOrderMoney() {
		return orderMoney;
	}

	public void setOrderMoney(Double orderMoney) {
		this.orderMoney = orderMoney;
	}

	public Double getDiscountMoney() {
		return discountMoney;
	}

	public void setDiscountMoney(Double discountMoney) {
		this.discountMoney = discountMoney;
	}

	public Double getPayMoney() {
		return payMoney;
	}

	public void setPayMoney(Double payMoney) {
		this.payMoney = payMoney;
	}

	public String getDiscountDes() {
		return discountDes;
	}

	public void setDiscountDes(String discountDes) {
		this.discountDes = discountDes;
	}

	public Date getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getExtStatus() {
		return extStatus;
	}

	public void setExtStatus(Integer extStatus) {
		this.extStatus = extStatus;
	}

	public Long getProviderId() {
		return providerId;
	}

	public void setProviderId(Long providerId) {
		this.providerId = providerId;
	}

	public String getProviderName() {
		return providerName;
	}

	public void setProviderName(String providerName) {
		this.providerName = providerName;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getMailGoods() {
		return mailGoods;
	}

	public void setMailGoods(String mailGoods) {
		this.mailGoods = mailGoods;
	}

	public String getInvoiceTitle() {
		return invoiceTitle;
	}

	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public boolean isWeekendRec() {
		return isWeekendRec;
	}

	public void setWeekendRec(boolean isWeekendRec) {
		this.isWeekendRec = isWeekendRec;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getContactTel() {
		return contactTel;
	}

	public void setContactTel(String contactTel) {
		this.contactTel = contactTel;
	}


	public Boolean getMail() {
		return mail;
	}

	public void setMail(Boolean mail) {
		this.mail = mail;
	}

	public Double getMailFee() {
		return mailFee;
	}

	public void setMailFee(Double mailFee) {
		this.mailFee = mailFee;
	}

	public String getThirdOrderNo() {
		return thirdOrderNo;
	}

	public void setThirdOrderNo(String thirdOrderNo) {
		this.thirdOrderNo = thirdOrderNo;
	}

	public Date getValidTime() {
		return validTime;
	}

	public void setValidTime(Date validTime) {
		this.validTime = validTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getServedPerson() {
		return servedPerson;
	}

	public void setServedPerson(String servedPerson) {
		this.servedPerson = servedPerson;
	}

	@SuppressLint("NewApi")
	@Override
	public int compareTo(OrderBean another) {
		long ttime = this.getOrderTime().getTime();
		long atime = another.getOrderTime().getTime();
		int timeC = Long.compare(ttime, atime);
		if(timeC == 0){
			return -Long.compare(this.getId(), another.getId());
		}
		return -timeC;
	}
//		 * 用车司机端：            21：待接单       22：已接单(未开始服务之前)    23: 已完成（服务已完成未支付费用）   4:已关闭（客户取消、超时未接、拒接）
	private String[] statusArr = {"待接单","已接单","已完成","已关闭"};
	public String getStatusName(){
		String result = statusArr[3];
		if(status == 21){
			result = statusArr[0];
		}
		else if(status == 22){
			result = statusArr[1];
		}
		else if(status == 23){
			result = statusArr[2];
		}
		else if(status == 4){
			result = statusArr[3];
		}
		return result;
	}
}
